//
//  qjTableViewController.m
//  jiaxingOASystem
//
//  Created by michael on 16/9/13.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "qjTableViewController.h"
#import "fTableViewController.h"
#import "sTableViewController.h"

@interface qjTableViewController ()
@property (nonatomic,strong)NSArray* array;

@end

@implementation qjTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"请假管理";
     _array = [NSArray arrayWithObjects:@"请假申请",@"因私出国(境)报告",nil];
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{
return 2;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    UITableViewCell *cell = [[UITableViewCell alloc]init];
    UIImageView *image = [[UIImageView alloc]initWithFrame:CGRectMake(15, 15, 40, 40)];
    image.image = [UIImage imageNamed: _array[indexPath.row]];
[cell.contentView addSubview:image];
//    cell.imageView.image = [UIImage imageNamed: _array[indexPath.row]];
    cell.imageView.size = CGSizeMake(30 ,30);
    UILabel *textLabel = [[UILabel alloc]init];
    textLabel.frame = CGRectMake(image.right+10, 5, 200, 60);
    textLabel.text = _array[indexPath.row];
    [cell.contentView addSubview:textLabel];
//    UILabel  *label= [[UILabel alloc]initWithFrame:CGRectMake(45, 10, 15, 15)];
//    label.backgroundColor = [UIColor redColor];
//    label.layer.cornerRadius = 7;
//    label.layer.masksToBounds = YES;
//    label.textAlignment = NSTextAlignmentCenter;
////    label.font = [UIFont boldSystemFontOfSize:2.0];
//    label.textColor = [UIColor whiteColor];
//    
//UIFont *font = [UIFont boldSystemFontOfSize:(10)];
//label.font = font;
//    [cell.contentView addSubview:label];
//
//    if (indexPath.row==0) {
//        label.text = self.read;
//        if ([self.read integerValue] !=0) {
//            label.hidden = NO;
//        }else{
//         label.hidden = YES;
//        }
//    }else{
//    label.hidden = YES;
//    
//    }


    
    
    
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 70;
}

- (void )tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];

if (indexPath.row==0) {
     fTableViewController*invc = [[fTableViewController alloc]init];
      UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:nil action:nil];
    self.navigationItem.backBarButtonItem = barButtonItem;

    [self.navigationController pushViewController:invc animated:YES];
}
if(indexPath.row==1) {
    sTableViewController *sendvc =[[sTableViewController alloc]init];
     UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:nil action:nil];
    self.navigationItem.backBarButtonItem = barButtonItem;
        [self.navigationController pushViewController:sendvc animated:YES];
}
}

@end
